<template>
	<view class="content">
		<view class="message_item" v-for="(item ,index) in list" :key="index" @click="navRoute(item)" :style="{opacity:item.status==2?'0.4':'1'}">
			<view class="" style="display: flex;">
				<view class="title"> 
				{{item.title}}
			</view>
			<view class="time">
				{{item.time}}
			</view>
			</view>
			
			<view class="content_text">
				<u-parse :html="item.content"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[]
			}
		},
		onLoad() {
			this.newData()
		},
		methods: {
			newData(){
				this.$myRuquest('home/Forums/message_list').then(res=>{
					if(res.code==400){
						this.list=res.data
						this.list.forEach(item=>{
							item.time= this.$u.timeFormat(item.time, 'yyyy-mm-dd hh:MM:ss');
						})
					}
				})
			},
			navRoute(data) {
				uni.navigateTo({
					url: `./message/message?data=${encodeURIComponent(JSON.stringify(data))}`
				});
			},
		}
	}
</script>

<style lang="less" scoped>
.content{
	background-color: #F4F5F7;
	padding: 20upx;
	min-height: 100vh;
	
	.message_item{
		background-color: #fff;
		border-radius: 12upx;
		margin: 20upx 0;
		padding: 20upx;
		.title{
			font-size: 28upx;
			font-weight: 900;
			flex: 3;
		}
		.time{
			font-size: 24upx;
			color: #666666;
			flex: 2;
			text-align: right;
		}
		.content_text{
			font-size: 26upx;
			color: #333333;
			// /deep/.interlayer{
				overflow: hidden;
			text-overflow:ellipsis;
			white-space: nowrap;
			// }
			
		}
	}
}
</style>
